<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>新增就诊记录- 萌迹(Cute Trial Admin)后台管理系统</title>
<link rel="icon" href="petvet.ico" type="image/ico">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<!--标签插件-->
<link rel="stylesheet" href="js/jquery-tags-input/jquery.tagsinput.min.css">
<link href="css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          
          <form action="#!" method="post" class="row">
            <div class="form-group col-md-12">
              <label for="petId">宠物信息</label>
              <input type="text" class="form-control" id="petId" name="petId" value="" placeholder="" />
            </div>
            <div class="form-group col-md-12">
              <label for="ownerId">主人信息</label>
              <input type="text" class="form-control" id="ownerId" name="ownerId" value="" placeholder=""/>
            </div>
            <div class="form-group col-md-12">
              <label for="doctorId">医生信息</label>
              <input type="text" class="form-control" id="doctorId" name="doctorId" value="" placeholder=""/>
            </div>
            <div class="form-group col-md-12">
              <label for="visitDate">就诊日期</label>
              <input type="text" class="form-control" id="visitDate" name="visitDate" value="" placeholder="yyyy-xx-zz 00:00:00"/>
            </div>
            <div class="form-group col-md-12">
              <label for="symptoms">症状描述</label>
              <input type="text" class="form-control" id="symptoms" name="symptoms" value="" placeholder=""/>
            </div>
            <div class="form-group col-md-12">
              <label for="diagnosis">诊断结果</label>
              <input type="text" class="form-control" id="diagnosis" name="diagnosis" value="" placeholder=""/>
            </div>
            <div class="form-group col-md-12">
              <label for="treatment">治疗方案</label>
              <input type="text" class="form-control" id="treatment" name="treatment" value="" placeholder="" />
            </div>
            <div class="form-group col-md-12">
              <label for="prescription">处方药物</label>
              <input type="text" class="form-control" id="prescription" name="prescription" value="" placeholder="" />
            </div>
            <div class="form-group col-md-12">
              <label for="examination">检查项目</label>
              <input type="text" class="form-control" id="examination" name="examination" value="" placeholder="" />
            </div>
            <div class="form-group col-md-12">
              <label for="examResult">检查结果</label>
              <input type="text" class="form-control" id="examResult" name="examResult" value="" placeholder="" />
            </div>
            <div class="form-group col-md-12">
              <button type="button" onclick="addm()" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>
 
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!--标签插件-->
<script src="js/jquery-tags-input/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript">
  function addm() {
    var params = {
      "petId": $("#petId").val(),
      "ownerId": $("#ownerId").val(),
      "doctorId": $("#doctorId").val(),
      "visitDate": $("#visitDate").val(),
      "symptoms": $("#symptoms").val(),
      "diagnosis": $("#diagnosis").val(),
      "treatment": $("#treatment").val(),
      "prescription": $("#prescription").val(),
      "examination": $("#examination").val()
    }

<!--添加用户信息-->
  $.getJSON("http://localhost:8080/pethospital/medicalRecord/add", params,
        function(riv) {
  if (riv.code == 1) {
    alert("添加成功");
    location.href = "pet_medical_record.html";
  } else {
    alert(data.msg);
  }
});
}
</script>
</body>
</html>